﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace MangaManagerLib
{
    public class WebWorker
    {
        public static string GetContent(string url)
        {
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
            if (resp.StatusCode != HttpStatusCode.OK)
                return null;
            StreamReader reader = new StreamReader(resp.GetResponseStream() );
            string sourceCode = reader.ReadToEnd();
            reader.Close();
            resp.Close();
           
            return sourceCode;
        }
    }
}
